#pragma once
#include "GalconTypes.h"
#include <boost/enable_shared_from_this.hpp>
class QPixmap;

class Ship : public QGraphicsObject, public boost::enable_shared_from_this<Ship>
{
   Q_OBJECT

public:

   Ship(const PlanetPtr destinationPlanet, const unsigned int countOfShips, 
        const PlayerID playerID, const qreal defaultAngle = 0,
        bool notifyOnArrival = false, QGraphicsItem *parent = 0);

   ~Ship();

   virtual QRectF boundingRect() const;

   PlayerID OwnerPlayerID() const { return m_sourcePlayerID; }

   bool NotifyOnArrival() const { return m_notifyOnArrival; }

signals:

   void arrivedToPlanet(ShipPtr, const PlanetPtr , const unsigned int , const PlayerID);

protected:

   virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget /* = 0 */);

private:
   void disconnectSignals();
   const PlanetPtr m_destinationPlanet;
   const unsigned int m_countOfShips;
   const PlayerID m_sourcePlayerID;
   QPixmap m_pixmap; 
   const qreal m_defaultRotationAngle;
   const bool m_notifyOnArrival;
};
